package com.xiaokai;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class TimeGenerator {

    public static void main(String[] args) {
        String requireReceiveTime = generateTimeTwoHoursLater();
        System.out.println(requireReceiveTime);
    }

    public static String generateTimeTwoHoursLater() {
        LocalDateTime currentTime = LocalDateTime.now();
        LocalDateTime timeTwoHoursLater = currentTime.plusHours(2);
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        return timeTwoHoursLater.format(formatter);
    }
}